package com.xuelang.pipeline.client.pipeline.enums;

import lombok.Getter;

/**
 * @author liuyuan.ly
 * @since 2024/7/23 11:28
 */

@Getter
public enum ApproveEnum {

    noPass("0", "refused"),
    pass("1", "success");


    final String key;
    final String value;

    ApproveEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }
    public static ApproveEnum fromKey(String key) {
        for (ApproveEnum approveEnum : values()) {
            if (approveEnum.key.equals(key)) {
                return approveEnum;
            }
        }
        throw new IllegalArgumentException("Invalid value: " + key);
    }
}
